import path from 'path'
import fs from 'fs'

/** 小雪类（祖宗类） */
class XiaoXue {
    /** XiaoXuePlugin根目录绝对路径 */
    XiaoXueRootAbsPath
    /** XiaoXuePlugin版本号 */
    XiaoXuePluginVersion

    constructor() {
        this.XiaoXueRootAbsPath = path.join(process.cwd(),'plugins/XiaoXuePlugin')
        const packageJsonPath = path.join(this.XiaoXueRootAbsPath,'package.json')
        this.XiaoXuePluginVersion = JSON.parse(String(fs.readFileSync(packageJsonPath)))['version']
    }
}

export { XiaoXue }